package material.command.receiver_命令接收者;

/**
 * 热水浴缸
 */
public class Hottub {
    boolean on;//开启标识
    int temperature;//当前浴缸的温度

    public Hottub() {
    }

    public void on() {
        on = true;
    }

    public void off() {
        on = false;
    }

    /**
     * 开始循环加热
     */
    public void circulate() {
        if (on) {
            System.out.println("浴缸加热完成!");
        }
    }

    /**
     * 注水
     */
    public void jetsOn() {
        if (on) {//保证浴缸是在启动状态
            System.out.println("正在注水");
        }
    }

    /**
     * 停止注水
     */
    public void jetsOff() {
        if (on) {
            System.out.println("浴缸注水结束");
        }
    }

    /**
     * 设置控制温度
     *
     * @param temperature
     */
    public void setTemperature(int temperature) {
        if (temperature > this.temperature) {
            System.out.println("热水器正在加热到蒸汽的温度 " + temperature + " degrees");
        } else {
            System.out.println("热水盆正在冷却  " + temperature + " degrees");
        }
        this.temperature = temperature;
    }
}
